<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>News</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="css/comic.css" />
	<link type="text/css" rel="stylesheet" href="css/nav.css" />
	<link type="text/css" rel="stylesheet" href="../../css/pepper-grinder/jquery-ui-1.8.16.custom.css" />
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.mousewheel.min.js"></script>
	<script type="text/javascript" src="../../js/popeScroll.js"></script>
	<script language="JavaScript" type="text/JavaScript">
		var is1 = false;
		$(document).ready(function() {
			$(window).resize(function() {
				refresh();
			});
			refresh();			
			$('#navigation a').stop().animate({'marginLeft':'-65px'},1000);

			$('#navigation > li').hover(
				function () {
					$('a',$(this)).stop().animate({'marginLeft':'-2px'},200);
				},
				function () {
					$('a',$(this)).stop().animate({'marginLeft':'-65px'},200);
				}
			);

			
			$("#nav1").click();
			$("#content").popeScroll({
				offset_top:-300,
				mousewheelBox:"box"
			});

		});

		function refresh(){
			var winheight = $(window).height();
			var winwidth = $(window).width();
			$("#bodydiv").css("height",winheight);
			$("#leftdiv").css("height",winheight);
			//$("#content").css("height",winheight-100);
			$("#box").css("height",winheight-100);
			if(is1){
				$("#box").css("width","70%");
				$("#box").css("margin-left","15%");
			}else{
				$("#box").css("width","100%");
				$("#box").css("margin-left","0");
			}
			
			$(".imgdiv").css("width",winheight*0.15);
			$(".imgdiv").css("height",winheight*0.20);
			$(".comiccontent").css("width",winwidth*0.7);
			$(".imgBig").css("height",winwidth*0.25);
			$(".imgCard").css("height",winwidth*0.25);
			//$("#content").css("height",winwidth*2.8);
			
			
		}

		function search(){
			var key = $("#searchInput").val();
			if(key==null||key==""){
				return;
			}
			$.getJSON("comic_getComicListToJsonByLikeName.do",{comicLikeName:key},function(json){
					$("#content").empty();
					divcount = json.length;
					hidediv = 1
					for(var i=0;i<json.length;i++){
						var contentstr = json[i].content;
						if(contentstr.length>200){
							contentstr = contentstr.substring(0,200)+"...";
						}else{
						
						}
						var divstr = '<div class="comic" style="width:100%;float:left;"><div class="imgdiv" style="padding-left:40px;padding-top:20px;float:left;"><img onclick="showComic(this)" id="'+json[i].id+'" src="'+json[i].pageurl+'" style="width:100%;height:100%;cursor:pointer;border:#f8f7f0 2px solid;"/></div><div  style="float:left;padding-left:20px;padding-top:15px;" ><div style="padding-top:5px;">'+json[i].name+'</div><div style="padding-top:5px;">'+"更新至："+json[i].state+'</div><div style="padding-top:5px;">'+"作者："+json[i].author+'</div><div id="content" class="comiccontent" style="padding-top:5px;width:500px;">'+"简介："+contentstr+'</div></div></div>';
						$("#content").append(divstr);
					}
					
					refresh();

			});
		}

		function showContent(num){
			$("#content").empty();
			if(num==1){
				is1 = true;
				$.getJSON("comic_searchTop10ByOrder.do",{},function(json){
					
					divcount = json.length;
					hidediv = 1
					for(var i=0;i<json.length;i++){
						var contentstr = json[i].content;
						if(contentstr.length>200){
							contentstr = contentstr.substring(0,200)+"...";
						}else{
						
						}
						//var divstr2 = '<div class="comic" style="width:100%;float:left;"><div class="imgdiv" style="padding-left:40px;padding-top:20px;float:left;"><img onclick="showComic(this)" id="'+json[i].id+'" src="'+json[i].pageurl+'" style="width:100%;height:100%;cursor:pointer;border:#f8f7f0 2px solid;"/></div><div  style="float:left;padding-left:20px;padding-top:15px;" ><div style="padding-top:5px;">'+json[i].name+'</div><div style="padding-top:5px;">'+"更新至："+json[i].state+'</div><div style="padding-top:5px;">'+"作者："+json[i].author+'</div><div id="content" class="comiccontent" style="padding-top:5px;width:500px;">'+"简介："+contentstr+'</div></div></div>';
						//if(i<3){
						//	var divstr = '<div class="cardBig"><img onclick="showComic(this)" id="'+json[i].id+'" src="images/'+json[i].ordernum+'.jpg" class="imgBig"/><div class="cardtitle transparent_class">'+json[i].name+'</div></div>';
						//}else{
						//	var divstr = '<div class="card"><img onclick="showComic(this)" id="'+json[i].id+'" src="images/'+json[i].ordernum+'.jpg" class="imgCard"/><div class="cardtitle transparent_class">'+json[i].name+'</div></div>';
						//}
						
						var divstr = '<div class="card"><img onclick="showComic(this)" id="'+json[i].id+'" src="images/'+json[i].ordernum+'.jpg" class="imgCard"/><div class="cardtitle transparent_class">'+json[i].name+'&nbsp;&nbsp;更新至：'+json[i].state+'</div></div>';
						
						$("#content").append(divstr);
					}
					
					
					refresh();
					
				});
			}else if(num==2){
				is1 = false;
				$.getJSON("comic_searchTop10ByRec.do",{},function(json){
					
					divcount = json.length;
					hidediv = 1
					for(var i=0;i<json.length;i++){
						var contentstr = json[i].content;
						if(contentstr.length>200){
							contentstr = contentstr.substring(0,200)+"...";
						}else{
						
						}
						var divstr = '<div class="comic" style="width:100%;float:left;"><div class="imgdiv" style="padding-left:40px;padding-top:20px;float:left;"><img onclick="showComic(this)" id="'+json[i].id+'" src="'+json[i].pageurl+'" style="width:100%;height:100%;cursor:pointer;border:#f8f7f0 2px solid;"/></div><div  style="float:left;padding-left:20px;padding-top:15px;" ><div style="padding-top:5px;">'+json[i].name+'</div><div style="padding-top:5px;">'+"更新至："+json[i].state+'</div><div style="padding-top:5px;">'+"作者："+json[i].author+'</div><div id="content" class="comiccontent" style="padding-top:5px;width:500px;">'+"简介："+contentstr+'</div></div></div>';
						$("#content").append(divstr);
					}
					
					
					refresh();
				});
			}else if(num==3){
				is1 = false;
				$.getJSON("comic_searchTop10ByRandom.do",{},function(json){
					
					divcount = json.length;
					hidediv = 1
					for(var i=0;i<json.length;i++){
						var contentstr = json[i].content;
						if(contentstr.length>200){
							contentstr = contentstr.substring(0,200)+"...";
						}else{
						
						}
						var divstr = '<div class="comic" style="width:100%;float:left;"><div class="imgdiv" style="padding-left:40px;padding-top:20px;float:left;"><img onclick="showComic(this)" id="'+json[i].id+'" src="'+json[i].pageurl+'" style="width:100%;height:100%;cursor:pointer;border:#f8f7f0 2px solid;"/></div><div  style="float:left;padding-left:20px;padding-top:15px;" ><div style="padding-top:5px;">'+json[i].name+'</div><div style="padding-top:5px;">'+"更新至："+json[i].state+'</div><div style="padding-top:5px;">'+"作者："+json[i].author+'</div><div id="content" class="comiccontent" style="padding-top:5px;width:500px;">'+"简介："+contentstr+'</div></div></div>';
						$("#content").append(divstr);
					}
					
					
					refresh();
				});
			}
		}

		function showComic(obj){
			window.parent.resizeWin("comic1",0.9,0.9);
			window.location.href = "showcomic.html?id="+obj.id;
			//window.parent.showapp("compents/comic/showcomic.html?id="+obj.id);
		}
		
	</script>
</head>
<body style="background-color=transparent;width:100%;margin-left:0px;margin-top:0px;">
	<div id="bodydiv" style="background:url(../../image/bg/5.png)">
		<div id="leftdiv" style="width:98%;float:left;">
			<div style="float:left;padding-left:25px;width:100%;height:40px;">
				<div style="float:left;padding-top:15px;">漫画搜索：</div>
				<div style="float:left;padding-top:9px;"><input type="text" id="searchInput" ></div>
				<div style="float:left;"><img onclick="search();" title="搜索" src="../../image/icon/png-0005.png" style="width:22px;height:22px;cursor:pointer;padding-top:10px;" /> </div>
				
			</div>
			
			<div id="box" style="overflow:hidden;width:70%;float:left;margin-left:15%;">
				<div id="content" style="float:left;width:100%;">
					
					
				</div>
			</div>
		</div>
		
	</div>
	<ul id="navigation">
		<li class="bjtj"><a id="nav1" href="#" onclick="showContent(1);"  title="编辑推荐"></a></li>
		<li class="rmlz"><a id="nav2" href="#" onclick="showContent(2);" title="热门连载"></a></li>
		<li class="tmh"><a id="nav3" href="#" onclick="showContent(3);"  title="淘漫画"></a></li>
		
	</ul>
	
	
</body>
</html>